<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="__PUBLIC__/admin/lib/html5shiv.js"></script>
    <script type="text/javascript" src="__PUBLIC__/admin/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/main1.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="__PUBLIC__/admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <script type="text/javascript" src="__PUBLIC__/admin/js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__/admin/js/action.js"></script>

    <title>订单详情</title>
    <style>
        #picInput>input{
            display: block;
            margin: 10px;
        }
    </style>

</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单管理 <span class="c-gray en">&gt;</span> 订单详情
</nav>
<div class="page-container">
    <div class="ncap-order-details" style="width: 70%;margin: 0 auto;">
        <form class="form form-horizontal" >
            <div class="tabs-panels">
                <div class="misc-info">
                    <h3>基本信息</h3>
                    <dl>
                        <dt>订单 ID：</dt>
                        <dd><?php echo $order_info['id'];?></dd>
                        <dt>订单号：</dt>
                        <dd><?php echo $order_info['order_sn'];?></dd>
                        <dt>会员：</dt>
                        <dd><?php echo $order_info['name'];?> &nbsp;&nbsp; ID:&nbsp;<?php echo $order_info['uid'];?></dd>
                    </dl>
                    <dl>
                        <dt>E-Mail：</dt>
                        <dd></dd>
                        <dt>电话：</dt>
                        <dd><?php echo $order_info['user_tel'];?></dd>
                        <dt>应付金额：</dt>
                        <dd><?php echo number_format($order_info['amount'],2); ?></dd>
                    </dl>
                    <dl>
                        <dt>订单状态：</dt>
                        <dd>
                            <!--<select id="zt_order_update">-->
                              <!--<option value="">全部状态</option>-->
                              <?php foreach ($order_status as $key => $val) { ?>
                              <!--<option value="<?php echo $key; ?>" <?php if($order_info['status']==$key) { ?>selected="selected"<?php } ?> >- <?php echo $val; ?></option>-->
                              <?php if($order_info['status']==$key) { echo $val; } ?>
                              <?php } ?>
                            <!--</select>-->
                        </dd>
                        <dt>下单时间：</dt>
                        <dd><?php echo $order_info['addtime'];?></dd>
                        <dt>支付方式：</dt>
                        <dd>微信支付</dd>
                    </dl>
                </div>
                <div class="addr-note">
                    <h3>收货信息</h3>
                    <dl>
                        <dt>收货人：</dt>
                        <dd><?php echo $order_info['receiver'];?></dd>
                        <dt>联系方式：</dt>
                        <dd><?php echo $order_info['tel'];?></dd>
                    </dl>
                    <dl>
                        <dt>收货地址：</dt>
                        <dd><?php echo $order_info['address_xq'];?></dd>
                    </dl>
                </div>
                <div class="goods-info">
                    <h3>商品信息</h3>
                    <table>
                        <thead>
                        <tr>
                            <th >产品名称</th>
                            <th>产品价格</th>
                            <th >数量</th>
                            <th >总价</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name='order_pro' id="pro">
                            <tr id="concent_tr_{$pro.id}" class="text-c">
                                <td>{$pro.name}</td>
                                <td>￥ {$pro.price}</td>
                                <td>{$pro.num}</td>
                                <td><font style="color:#c00;">￥ <?php echo number_format($pro['price']*$pro['num'],2); ?></font></td>
                            </tr>
                        </volist>

                        </tbody></table>
                </div>
                <div class="total-amount contact-info">
                    <h3>订单总额：￥<?php echo $order_info['price'];?></h3>
                </div>
                <div class="contact-info">
                    <h3>费用信息 </h3>
                    <dl>
                        <dt>小计：</dt>
                        <dd><?php echo $order_info['price'];?></dd>
                        <dt>积分 (-0)：</dt>
                        <dd>-<?php echo $order_info['price_h'];?></dd>
                    </dl>
                    <dl>
                        <dt></dt>
                        <dd></dd>
                        <dt>应付：</dt>
                        <dd><strong class="red_common"><?php echo $order_info['amount'];?></strong></dd>
                    </dl>
                </div>
                <?php if($order_info['status'] > 20){ ?>
                <div class="contact-info">
                    <h3>物流信息</h3>
                    <dl class="row">
                        <dt class="tit">
                            <label for="note">发货快递：</label>
                        </dt>
                        <dd class="opt" style="margin-left:10px">
                            <select name="kuaidi_name" id="kuaidi_name">
                                <option value="0">请选择</option>
                                <!-- <volist name="wuliu" id="vo" key="key">
                                     <option value="{$vo.code}">{$vo.name}</option>
                                 </volist>-->
                                <?php foreach ($wuliu as $key => $val) { ?>
                                <option value="<?php echo $key; ?>" <?php if($order_info['post']==$key) { ?>selected="selected"<?php } ?> ><?php echo $val; ?></option>
                                <?php } ?>
                            </select>
                        </dd>
                        <dt class="tit">
                            <label for="note">快递单号：</label>
                        </dt>
                        <dd class="opt" style="margin-left:10px">
                            <input id="kuaidi_num" value="<?php echo $order_info['kuaidi_num'];?>"/><?php if($order_info['kuaidi_num'] != null) {?>
                            <a href="checkWuliu?nu=<?php echo $order_info['kuaidi_num']; ?>&code=<?php echo $order_info['post']; ?>">查看物流</a>
                            <?php }?>
                        </dd>
                    </dl>
                    <?php if($order_info['status'] == 30){ ?>
                    <dl class="row">
                        <dt class="tit">
                        </dt>
                        <dd class="opt" style="margin-left:10px">
                            <input type="button" value="提交" style="" onclick="sms_message()" class="btn btn-success"/>
                            <br>
                            <input type="hidden" value="<?php echo $order_info['status']; ?>" name="o_status" id="o_status">
                        </dd>
                    </dl>
                    <?php } ?>
                </div>
                <?php } ?>
            </div>
        </form>
    </div>

</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__PUBLIC__/admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__PUBLIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/lib/laypage/1.2/laypage.js"></script>
<script>


    //保存快递名称，快递单号
    function sms_message(){
        try{
            //if(!confirm('确定发送订单发货短信吗？')) return;
            //获取订单当前状态
            var o_status = $('#o_status').val();
            //获取订单选择状态
            var order_status = $('#zt_order_update').val();
            //选择状态不能比当前状态小，已付款的订单不能变成未付款
            //if (order_status && order_status!=40 && order_status<o_status) {return;};
            //获取快递名称
            var kuaidi_name = $('#kuaidi_name').val();
            if(kuaidi_name.length<1 && order_status==30) throw ('快递名称不能为空！');
            //获取快递单号
            var kuaidi_num = $('#kuaidi_num').val();
            if(kuaidi_num.length<1 && order_status==30) throw ('运单号不能为空！');

            if (!order_status && kuaidi_num.length<1 && kuaidi_name.length<1) {
                throw ('请输入快递信息或选择订单状态！');
            };
            $.ajax({
                type: "POST",
                url: "{:U('sms_up')}",
                data:{'order_status':order_status,'kuaidi_name':kuaidi_name,'kuaidi_num':kuaidi_num,'oid':<?php echo $order_info['id'];?>},
                dataType: "json",
                success: function (data) {
                if(data.returns){
                    alert('提交成功！');
                    window.reload();
                }else{
                    alert(data.message);
                }

            },
            error: function (msg) {
                alert ('网络连接失败！');
            }
        });

        }catch(e){
            alert(e);
        }
    }
</script>
</body>
</html>
